#include "gridItem.h"

gridItem::gridItem(int _x, int _y, int _w, int _h){
	this->x = _x;
	this->y = _y;
	this->width = _w;
	this->height = _h;
}
int gridItem::getX(){
	return this->x;
}

int gridItem::getY(){
	return this->y;
}

int gridItem::getWidth(){
	return this->width;
}

int gridItem::getHeight(){
	return this->height;
}

int gridItem::getBoundX(){
	return this->x + this->width;
}

int gridItem::getBoundY(){
	return this->y + this->height;
}

void gridItem::assign(gridItem _newItem){
	this->x = _newItem.getX();
	this->y = _newItem.getY();
	this->width = _newItem.getWidth();
	this->height = _newItem.getHeight();
}

bool gridItem::checkPixelInBound(int _xpixel, int _ypixel){
	if( _xpixel >= x && _xpixel < getBoundX()){
		if(_ypixel >= y && _ypixel < getBoundY()){
			return true;
		}
		return false;
	}
	return false;
}